/****************************************************************************
Generated from F:\Fang_WorkNotes\project\DR\SW\DR_V003\apps\applications\earbud\qcc512x_qcc302x\QCC3020-AA_DEV-BRD-R2-AA\dfu\dfu-public.key
by C:\qtil\ADK_QCC512x_QCC302x_WIN_6.3.0.154\tools\gen_rsa_pss_constants.py
at 09:47:31 19/11/2018

FILE NAME
    rsa_pss_constants.c

DESCRIPTION
    Constant data needed for the rsa_decrypt and the ce_pkcs1_pss_padding_verify
    function.

NOTES
    The constant data for the rsa_decrypt is generated by the host from the
    RSA public key and compiled into the CONFIG_HYDRACORE VM upgrade library.
    It is directly related to the RSA private and public key pair, and if they
    change then this file must be regenerated from the public key.

****************************************************************************/

#include "rsa_decrypt.h"

/*
 * The const rsa_mod_t *mod parameter for the rsa_decrypt function.
 */
const rsa_mod_t rsa_decrypt_constant_mod = {
    /* uint16 M[RSA_SIGNATURE_SIZE] where RSA_SIGNATURE_SIZE is 128 */
    {
        0xc7a9,     /* 00 */
        0x4fd3,     /* 01 */
        0x3d82,     /* 02 */
        0x906d,     /* 03 */
        0x69f6,     /* 04 */
        0x3a02,     /* 05 */
        0x16f8,     /* 06 */
        0x0ed4,     /* 07 */
        0x9b5a,     /* 08 */
        0xc5c2,     /* 09 */
        0xa77c,     /* 10 */
        0xc0bf,     /* 11 */
        0xccbd,     /* 12 */
        0xbc28,     /* 13 */
        0x3519,     /* 14 */
        0x9ee3,     /* 15 */
        0xdbae,     /* 16 */
        0x718b,     /* 17 */
        0xd3ac,     /* 18 */
        0x4014,     /* 19 */
        0x5aa7,     /* 20 */
        0x648c,     /* 21 */
        0x3341,     /* 22 */
        0x348c,     /* 23 */
        0xb3b4,     /* 24 */
        0x834d,     /* 25 */
        0xab4a,     /* 26 */
        0xf883,     /* 27 */
        0x7ed1,     /* 28 */
        0x2961,     /* 29 */
        0x5504,     /* 30 */
        0x7591,     /* 31 */
        0x80b4,     /* 32 */
        0xf4ad,     /* 33 */
        0xe1ff,     /* 34 */
        0x3d3e,     /* 35 */
        0xcbf1,     /* 36 */
        0xc660,     /* 37 */
        0xd5fd,     /* 38 */
        0xaca3,     /* 39 */
        0x805d,     /* 40 */
        0x3c82,     /* 41 */
        0xe328,     /* 42 */
        0x86f5,     /* 43 */
        0x9b15,     /* 44 */
        0x20ee,     /* 45 */
        0xc8d7,     /* 46 */
        0x2996,     /* 47 */
        0x9f24,     /* 48 */
        0x584a,     /* 49 */
        0xc84c,     /* 50 */
        0x4900,     /* 51 */
        0x2939,     /* 52 */
        0xc8d0,     /* 53 */
        0x045f,     /* 54 */
        0xe7b6,     /* 55 */
        0x11e2,     /* 56 */
        0x5e85,     /* 57 */
        0xe6f3,     /* 58 */
        0x89f3,     /* 59 */
        0xa22a,     /* 60 */
        0x2e50,     /* 61 */
        0xdf0c,     /* 62 */
        0x47b4,     /* 63 */
        0x1862,     /* 64 */
        0x2ddc,     /* 65 */
        0xe1e0,     /* 66 */
        0xe225,     /* 67 */
        0xbd94,     /* 68 */
        0x34c5,     /* 69 */
        0xa120,     /* 70 */
        0x50dd,     /* 71 */
        0xd4a2,     /* 72 */
        0x6423,     /* 73 */
        0xec1e,     /* 74 */
        0x60a7,     /* 75 */
        0x5a64,     /* 76 */
        0x7d75,     /* 77 */
        0x246e,     /* 78 */
        0x5f37,     /* 79 */
        0x6b96,     /* 80 */
        0x558b,     /* 81 */
        0xbfa2,     /* 82 */
        0x6c22,     /* 83 */
        0xf15b,     /* 84 */
        0x4d2b,     /* 85 */
        0x7605,     /* 86 */
        0x59b5,     /* 87 */
        0x1fcc,     /* 88 */
        0x6985,     /* 89 */
        0xbf34,     /* 90 */
        0x1779,     /* 91 */
        0x67c4,     /* 92 */
        0xd1b0,     /* 93 */
        0x5c0d,     /* 94 */
        0x0bfb,     /* 95 */
        0x1729,     /* 96 */
        0xcd3e,     /* 97 */
        0x34b2,     /* 98 */
        0xfae9,     /* 99 */
        0x4c8a,     /* 100 */
        0x4557,     /* 101 */
        0x9339,     /* 102 */
        0xbc6b,     /* 103 */
        0x284b,     /* 104 */
        0x4b94,     /* 105 */
        0x420e,     /* 106 */
        0x9249,     /* 107 */
        0x7fd8,     /* 108 */
        0x05ca,     /* 109 */
        0xa4e9,     /* 110 */
        0xca70,     /* 111 */
        0xbe2d,     /* 112 */
        0xdcb2,     /* 113 */
        0x81c0,     /* 114 */
        0xfa07,     /* 115 */
        0x71c7,     /* 116 */
        0x632f,     /* 117 */
        0x027b,     /* 118 */
        0xa005,     /* 119 */
        0xcaa7,     /* 120 */
        0x21f8,     /* 121 */
        0x0d60,     /* 122 */
        0xc20c,     /* 123 */
        0x318b,     /* 124 */
        0xb9c4,     /* 125 */
        0x8fa2,     /* 126 */
        0x2581      /* 127 */
    },
    /* uint16 M_dash */
    0xe57f
};

/* 
 * The "lump of memory passed in initialised to R^2N mod M" needed for the
 * uint16 *A parameter for the rsa_decrypt function. This must be copied into
 * a writable array of RSA_SIGNATURE_SIZE uint16 from here before use.
 */
const  uint16 rsa_decrypt_constant_sign_r2n[RSA_SIGNATURE_SIZE] = {
    0xc540,     /* 00 */
    0x2de2,     /* 01 */
    0xd14e,     /* 02 */
    0x47ba,     /* 03 */
    0x242c,     /* 04 */
    0x0f4a,     /* 05 */
    0xebaa,     /* 06 */
    0x265f,     /* 07 */
    0x822f,     /* 08 */
    0x1235,     /* 09 */
    0x9607,     /* 10 */
    0x2d20,     /* 11 */
    0x9ab4,     /* 12 */
    0x3a83,     /* 13 */
    0xbc52,     /* 14 */
    0x22d4,     /* 15 */
    0x82c1,     /* 16 */
    0x3c24,     /* 17 */
    0x9eef,     /* 18 */
    0xa29a,     /* 19 */
    0x0e3e,     /* 20 */
    0xd55e,     /* 21 */
    0xc580,     /* 22 */
    0x7cec,     /* 23 */
    0x120d,     /* 24 */
    0xb087,     /* 25 */
    0x2a71,     /* 26 */
    0x55f2,     /* 27 */
    0xe851,     /* 28 */
    0x404b,     /* 29 */
    0x6bd0,     /* 30 */
    0x6cab,     /* 31 */
    0xf235,     /* 32 */
    0xefb8,     /* 33 */
    0x71cc,     /* 34 */
    0x8424,     /* 35 */
    0x6a38,     /* 36 */
    0xd22b,     /* 37 */
    0xfb01,     /* 38 */
    0x9f32,     /* 39 */
    0x7928,     /* 40 */
    0x0683,     /* 41 */
    0x121a,     /* 42 */
    0x2153,     /* 43 */
    0x008c,     /* 44 */
    0xecc5,     /* 45 */
    0x6b95,     /* 46 */
    0x050f,     /* 47 */
    0x29aa,     /* 48 */
    0x5049,     /* 49 */
    0xc570,     /* 50 */
    0xf595,     /* 51 */
    0x97b6,     /* 52 */
    0x783f,     /* 53 */
    0x6e97,     /* 54 */
    0x2f65,     /* 55 */
    0x6f5e,     /* 56 */
    0x6fbe,     /* 57 */
    0x9ff7,     /* 58 */
    0x8117,     /* 59 */
    0xc52b,     /* 60 */
    0x5cd6,     /* 61 */
    0xed26,     /* 62 */
    0x5a54,     /* 63 */
    0x092f,     /* 64 */
    0x49cc,     /* 65 */
    0xf6f8,     /* 66 */
    0x9836,     /* 67 */
    0x48b3,     /* 68 */
    0x3390,     /* 69 */
    0x2e23,     /* 70 */
    0x00b2,     /* 71 */
    0x1345,     /* 72 */
    0x0231,     /* 73 */
    0x5b39,     /* 74 */
    0x97e4,     /* 75 */
    0xf841,     /* 76 */
    0x6d6a,     /* 77 */
    0x0f7e,     /* 78 */
    0x4cbe,     /* 79 */
    0xcf93,     /* 80 */
    0xf0e2,     /* 81 */
    0xcd1e,     /* 82 */
    0x7c1f,     /* 83 */
    0xc524,     /* 84 */
    0x6527,     /* 85 */
    0xd668,     /* 86 */
    0x7bde,     /* 87 */
    0x20bb,     /* 88 */
    0x92b1,     /* 89 */
    0x7d7e,     /* 90 */
    0xd277,     /* 91 */
    0x6d53,     /* 92 */
    0xcaa3,     /* 93 */
    0x99f4,     /* 94 */
    0xcbc2,     /* 95 */
    0x4b4b,     /* 96 */
    0x3836,     /* 97 */
    0x1586,     /* 98 */
    0x82a5,     /* 99 */
    0xc1e6,     /* 100 */
    0x8ab0,     /* 101 */
    0x650b,     /* 102 */
    0xc62a,     /* 103 */
    0xcb3e,     /* 104 */
    0x6c76,     /* 105 */
    0xcf9e,     /* 106 */
    0xed75,     /* 107 */
    0x321b,     /* 108 */
    0xa969,     /* 109 */
    0x7004,     /* 110 */
    0x1ab7,     /* 111 */
    0x569c,     /* 112 */
    0x4623,     /* 113 */
    0x8b82,     /* 114 */
    0x0edf,     /* 115 */
    0x38f6,     /* 116 */
    0x25b6,     /* 117 */
    0x0573,     /* 118 */
    0x2aaf,     /* 119 */
    0xf81e,     /* 120 */
    0xcc01,     /* 121 */
    0x50db,     /* 122 */
    0x661e,     /* 123 */
    0x66a7,     /* 124 */
    0x0a95,     /* 125 */
    0xbb4f,     /* 126 */
    0xb209      /* 127 */
};

/*
 * The value to be provided for the saltlen parameter to the 
 * ce_pkcs1_pss_padding_verify function used to decode the PSS padded SHA-256
 * hash. It has to match the value that was used in the encoding process.
 */
const unsigned long ce_pkcs1_pss_padding_verify_constant_saltlen = 222;
